package com.ebupt.migu.music.pubBroadcast.controller;


import com.ebupt.migu.music.common.entity.ResultObject;
import com.ebupt.migu.music.pubBroadcast.entity.policyList.PolicyInfoBo;
import com.ebupt.migu.music.pubBroadcast.entity.policyList.PolicyListBo;
import com.ebupt.migu.music.pubBroadcast.service.PolicyListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 公播平台策略列表
 */
@RestController
@RequestMapping("/policyList")
public class PolicyListController {

    @Autowired
    private PolicyListService policyListService;


    /**
     * 策略列表
     * @param policyListBo
     * @return
     */
    @PostMapping(value = "/policyList")
    public ResultObject policyList(@RequestBody PolicyListBo policyListBo) {
        return policyListService.policyList(policyListBo);
    }

    /**
     * 策略查看
     * @param policyInfoBo
     * @return
     */
    @PostMapping(value = "/policyInfo")
    public ResultObject policyInfo(@RequestBody PolicyInfoBo policyInfoBo) {
        return policyListService.policyInfo(policyInfoBo);
    }

    /**
     * 删除
     * @param activityId
     * @return
     */
    @GetMapping(value = "/deletePolicy")
    public ResultObject deletePolicy(@RequestParam("activityId") String activityId) {
        return policyListService.deletePolicy(activityId);
    }

    /**
     * 暂停
     * @param activityId
     * @return
     */
    @GetMapping(value = "/pausePolicy")
    public ResultObject pausePolicy(@RequestParam("activityId") String activityId) {
        return policyListService.pausePolicy(activityId);
    }

    /**
     * 开始
     * @param activityId
     * @return
     */
    @GetMapping(value = "/startPolicy")
    public ResultObject startPolicy(@RequestParam("activityId") String activityId) {
        return policyListService.startPolicy(activityId);
    }
}
